<template>
	<view class="cityBox">
		<chose-city @selectCity="selectCity" @locationCity="locationCity" v-if="showCity" @closeModal="closeModal" :city="city"></chose-city>
	</view>
</template>

<script>
	import choseCity from "../../components/chose-city/chose-city.vue"
	export default {
		components: {
			choseCity
		},
		data() {
			return {
				showCity: true,
				city:'',//当前定位城市

			}
		},
		onLoad(opt){
			this.city=opt.city
		},
		methods: {
			selectCity(item) {
				uni.setStorageSync('selectCity',item)
				uni.$emit('city', item)
				this.goBack()
				console.log('-您选择的城市-', item)
				// this.showCity = false
			},
			locationCity(address){
				uni.$emit('locationCity', address)
				this.goBack()
			},
			closeModal() {
				this.showCity = false
			},
		}
	}
</script>

<style lang="scss" scoped>
.cityBox{
}
</style>
